[ticket/11586] Use a variable for $cat_id == ATTACHMENT_CATEGORY_IMAGE.

PHPBB3-11586
[ticket/11586] Combine $filedata['post_attach'] assign into a single statement.

PHPBB3-11586
[ticket/11586] Move $filedata['thumbnail'] to where it might be returned.

PHPBB3-11586