Replaced upload dialog with media library; Added edit function for images