Phones, cameras and other devices often use the orientation flag in the EXIF meta data, For portraits the raw file data is flipped sideways but most browsers support this flag and flip the image to the correct orientation.
plupload handles this correctly when resizing client side and preserves the EXIF data. Thumbnails processed by phpBB have the EXIF data stripped and the browser orients the image based on the raw file, sideways if it's s portrait.
Both Imagemagick and GD can handle this, for example if Imagemcick is selected for image manipulation on line 564 of includes/functions_posting.php if you add the -auto-orient flag you get the desired orientation for the thumbnail.
AFAIK Imagemagick should not be stripping the EXIF data to begin with, not sure why it is being stripped. Might be something to explore.
For GD to handle it correctly I believe the EXIF extension would need to be installed. I would propose a suitable solution may be having plupload handle thumbnail creation, that would avoid issues with server side compatibility.