Image upload

Fix the issues as pointed out in backgrounds controller in this controller also.