What about creating a separate file for handling the attachments? 'open' and 'pick' handlers in one file? Because the logic will grow up (limit of size algorithm, number of files...).