Image Preview and Drag & Drop Bug Fixes

Fixed a bug where folders where folders and files were not
discriminated, causing several issues.